Skip to main content

Constants

QQL allows using various types of constants with different operations with simple types and/or arrays.

Boolean

Examples: true, false.

Timestamp

The QQL syntax of date literals is different from SQL. Instead of something like DATE '...', the syntax is '...'d.

Date specification format:

<year>[-<month>[-<day>[ <hour (24)>[:<minute>[:<second>[.<fraction>]]]]]][ <time zone>]

Examples: '2020-10-13 11:22:48'd, '2021-01-01 11:42:48.553'd

This means that you can specify either a year only, or a year and a month, or a year, a month, and a day, and so on. However, the time zone can be specified or omitted independently. Any omitted values take reasonable defaults, such as January, 1st day of month, the GMT time zone and zeros for all other components.

Examples of valid date literals:

  • '2008'd
  • '2008 America/New_York'd
  • '2008-03-28'd
  • '2008-03-28 America/New_York'd
  • '2008-03-28 14'd
  • '2008-03-28 14:02:59.1'd
  • '2008-03-28 14:02:59.317859261'd

String Literals

In QQL requests you can embrace a string in a single quotes to make it a string literal. For example, you can use both identifiers and string literals after a keyword AS; therefore, embrace your entry in single quotes to make it a string literal. In the below example we use a string literal to set the alias for the SYMBOL column.

Using string literals
#Shell format
==> SELECT symbol AS '*Symbol*' FROM securities

>_,TIMESTAMP,SYMBOL,TYPE,*Symbol*
0,_,,SYSTEM,ESZ11
1,_,,SYSTEM,NQZ11
2,_,,SYSTEM,ESU11
3,_,,SYSTEM,NQU11
4,_,,SYSTEM,AAPL
5,_,,SYSTEM